var xwrtTabContainer = function(el){
	var that = this;
	this.main_div = el;//document.createElement("div");
	this.idx = 0;
	var firstEl = el.firstChild;
	var e = this.main_div.childNodes;
	var tabs_div = new TabPannel();
	this.content_div = document.createElement("div");
	this.tabsArray = [];

	alert(e.length);
	for (var i=0;i<e.length;i++){
		alert(e[i].nodeType);
		if(e[i].nodeTypeName!="#text"){
			e[i].style.display="none";
		}
	}
//	this.content_div=this.tabsArray[0];
	var uno = document.createElement("span");
	var dos = document.createElement("span");
	uno.style.margin="2px";
	dos.style.margin="2px";
	uno.innerHTML="Uno";
	dos.innerHTML="Dos";
	addEvent(uno, "click", this.showContent);
	addEvent(dos, "click", this.showContent);
	tabs_div.appendChild(uno);
	tabs_div.appendChild(dos);
	this.main_div.appendChild(tabs_div);
	this.main_div.appendChild(this.content_div);
	this.main_div.style.height="100%";
	this.content_div.style.borderLeft="1px solid #919b9c";
	this.content_div.style.borderRight="1px solid #919b9c";
	this.content_div.style.borderBottom="1px solid #919b9c";
	this.content_div.style.height=this.main_div.clientHeight-23+"px";
	this.showContent = function (x){
		for(var i=0;i<e.length;i++){
			e[i].style.display="none";
		}
		e[x].style.display="block";
	}
	this.showContent(0);
}

var TabPannel = function(){
	var pannel = document.createElement("div");
	pannel.style.height="21px";
	pannel.style.borderBottom="1px solid #919b9c";
	this.titles = [];
	this.addTitle = function(str_title){
		this.titles.push(str_title);
	}
	return pannel;
}

var xwrtTabContent = function(el){
	var title = el.getAttribute("title");
	alert(el.parentNode.getAttribute("xwrtType"));
	var container = el.getAttribute("container");
}